


<?php 
include 'connect.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<link rel="stylesheet" type="text/css" href="styles.css"/>
</head>
<body>
<div class="logo"></div> 
<div id="container">
<?php
$username = mysql_real_escape_string($_POST["username"]);
$password = mysql_real_escape_string($_POST["password"]);
$name = mysql_real_escape_string($_POST["name"]);
$email = mysql_real_escape_string($_POST["email"]);
$phone = mysql_real_escape_string($_POST["phone"]);

$password = md5($_POST['password']);

if(isset($_POST['submit'])) {
$sql = "INSERT INTO
					members (Username, Name, Email, Phone, Password )
				VALUES('" .$username . "',
						'" .$name . "',
						'" .$email . "',
					   '" .$phone . "',
					   '"  .$password . "')";
					   
			

		$result = mysql_query($sql);
		if(!$result)
		{
			//something went wrong, display the error
			echo 'Something went wrong while registering. Please try again later.';
			echo mysql_error(); //debugging purposes, uncomment when needed
		}
		else
		{
			echo "Success! Thank you for signing up! You will be redirected to the login page...";
		}
}

?>

<meta http-equiv="Refresh" content="5; url=http://localhost:8888/new/Project/index.php">
</div>
</body>
</html>